# 方法1
# 带入代码，一行行看
numbers = [2, 1, 4, 5, 1, 2]
a = max(numbers)

for i in range(1, a+1):
    if i in numbers:
        while i in numbers:
            numbers.remove(i)

    else:
        numbers.append(i)

print(set(numbers))

# 方法2
def func(nums):
    l = [i for i in range(1, len(nums) + 1)]
    l2 = []
    for i in l:
        if i in nums:
            continue
        else:
            l2.append(i)

    return l2

numbers = [2, 1, 4, 5, 100, 2]
print(func(numbers))